package Reflect;

import javax.management.monitor.Monitor;
import java.lang.reflect.Method;

public class ReflectDemo5 {
    public static void main(String[] args) throws Exception {
        Class cla=Class.forName("Reflect.Person");
        Object obj=cla.newInstance();

        Method method=cla.getMethod("say", String.class);
        method.invoke(obj,"hello");

        Method method1=cla.getMethod("say", String.class,int.class);
        method1.invoke(obj,"hello",5);


    }
}
